window.onload = function (){
    showOrder(1);
}
function showOrder(pageNo){
    axios.get("/custom/order/findAllByID",{
        params:{
            pageNo
        }
    }).then(e=>{
        var info = e.data;
        var str ="";
        for (var i=0;i<info.records.length;i++){
            var obj = info.records[i];

            str+=`<tr>
<td>${obj.id}</td><td>${obj.sumPrice}</td><td>${obj.status}</td><td>${obj.createDate}</td><td>
<a href="/custom/findOrder.html?id=${obj.id}">查看详情</a></td>
</tr>`
        }
        $("orderData").innerHTML =str;
        var cutPage="";
        for (var i=1;i<=info.pages;i++){
            cutPage+=`<a href="javascript:showOrder(${i})">${i}</a>`;
        }
        $("cutPageDiv").innerHTML = cutPage;
    })
}


function returnIndex(){
    location.href="/index.html";
}
